<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('统计分析')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>设备端：</p>
                                <input type="text" name="device"/>
                            </li>
                            <li>
                                <p>机顶盒设备号：</p>
                                <input type="text" name="cardno"/>
                            </li>
                            <li>
                                <p>ip地址：</p>
                                <input type="text" name="ip"/>
                            </li>
                            <li class="select-time">
                                <p>访问时间：</p>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginAddTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endAddTime]"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:visits:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:visits:export">
                    <i class="fa fa-download"></i> 导出
                 </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>

     <script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">

        var removeFlag = [[${@permission.hasPermi('system:visits:remove')}]];
        var prefix = ctx + "system/visits";

        $(function() {
            var options = {
                url: prefix + "/list",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "统计分析",
                columns: [{
                        title : '序号',
                        align: 'center',
                        formatter: function(value, row, index) {
                            return index+1;
                        }
                },
                {
                    field : 'id', 
                    title : 'null',
                    visible: false
                },
                {
                    field : 'device', 
                    title : '设备端'
                },
                {
                    field : 'cardno', 
                    title : '机顶盒设备号'
                },
                {
                    field : 'ip', 
                    title : 'ip地址'
                },
                {
                    field : 'addTime', 
                    title : '访问时间'
                },
                {
                    field : 'duration',
                    title : '访问时长',
                    formatter: function(value, row, index) {
                            return row.duration +'s';
                    }
                },
                {
                    field : 'platf', 
                    title : '节目'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });

        /*$(document).ready(function(){
            var formData = new FormData();
            var ip=returnCitySN.cip;
            formData.append('ip',ip);
            $.ajax({
                url: prefix + "/add",
                type: 'post',
                cache: false,
                data: formData,
                processData: false,
                contentType: false,
                dataType: "json",
                success: function(result) {
                }
            })
        });*/

    </script>
</body>
</html>